//
//  YFSportAndSensorApi.h
//  SquashSpark
//
//  Created by Coollang on 2017/11/28.
//  Copyright © 2017年 Coollang-YF. All rights reserved.
//

#import "YFBaseRequest.h"

@class YFDayRecordItem;
@interface YFSportAndSensorApi : YFBaseRequest

// 获取固件版本
+ (instancetype)getServerDeviceVersionWithOemTpe:(OemType)oemType completed:(void(^)(NSString *version,NSString *downloadPath,NSError *error))block;

// 获取有运动数据的日期
+ (instancetype)getHaveSportDataDays;
+ (instancetype)getDayStatisticsDataWithDay:(NSString *)day;
+ (instancetype)getDayStatisticsDetailWithDay:(NSString *)day;

// 上传天运动统计数据
+ (instancetype)uploadDayRecordDataWithItems:(NSArray <YFDayRecordItem *>*)dayItems completed:(void(^)(NSError *error))completed;
// 上传天的详情数据
+ (instancetype)uploadDayRecordDetailDataWithDayItem:(NSArray <YFDayRecordItem *>*)dayItems completed:(void(^)(NSError *error))completed;

// 页码,如果该页面能够向左滑动,则每滑动一次调用该接口.page+1.目前是倒序排列的.page+1 会向以前的日期读取数据
+ (instancetype)getWeekStaticsisDataWithPage:(NSInteger)page completed:(void(^)(BOOL success,NSDictionary *errDescJosn))completedBlock;
+ (instancetype)getMonthStaticsisDataWithPage:(NSInteger)page completed:(void(^)(BOOL success,NSDictionary *errDescJosn))completedBlock;
// 页码,如果该页面能够向左滑动,则每滑动一次调用该接口.page+1.目前是倒序排列的.page+1 会向上年读取数据
+ (instancetype)getYearStaticsisDataWithPage:(NSInteger)page completed:(void(^)(BOOL success,NSDictionary *errDescJosn))completedBlock;

/**
 下载固件包
 */
+ (NSURLSessionDownloadTask *)downLoadFirware:(NSURL *)url
                              downLoadProress:(void (^)(float progress))progress
                                   completion:(void  (^) (NSString *path, NSError *error))completion;

/**
 上传模板
 */
+ (void)addTemplateToServer:(YFThreeDTemplate *) uploadTemplate
                 completion:(void(^)(NSString *tempaleID ,NSError *error)) completion;

/**
 删除模板
 */
+ (void)deleteTemplateToServer:(NSArray <NSString *> *)deleteIDs
                      complete:(void(^)(NSError *error)) complete;

@end
